/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mathma.discrete.pair.form;

import mathma.core.expr.Expression;

import mathma.core.form.UnaryExpression;

import mathma.discrete.SymbolicValue;

import mathma.discrete.pair.OrderedPair;

/**
 * @since 0.2.5
 * @author Ethan Levine
 */
public class SecondPairOperandExpression<T>
        extends UnaryExpression<SymbolicValue<T>, OrderedPair<T>> {

    public SecondPairOperandExpression(Expression<OrderedPair<T>> operand) {
        super(SymbolicValue.GenericType, operand);
    }

    public SymbolicValue<T> evaluate() {
        return getOperand().evaluate().second();
    }

    public SecondPairOperandExpression<T> newUnaryExpression(
            Expression<OrderedPair<T>> operand) {
        return new SecondPairOperandExpression<T>(operand);
    }
}